<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class mGantiPass extends CI_Model {
	private $table_name='ADMINS';
	private $primary_key='ADMINNAME';

	function __construct() {
		parent::__construct();
	}	
	
	function get_by_pass($pass) {
		// $this->db->where('psw',$pass);
		// return $this->db->get($this->table_name);
		$result = $this->db->query('select * from admins where psw='.'\''.$pass.'\'');
		return $result;
	}
	
	function update($id,$person){
		$this->db->set('PSW',$person);
		$this->db->where($this->primary_key,$id);
		$this->db->update($this->table_name);
	}
	
}
?>